/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "REC_ACCION_COBRANZA")
@NamedQueries({@NamedQuery(name = "AccionCobranza.findAll", query = "SELECT a FROM AccionCobranza a"), @NamedQuery(name = "AccionCobranza.findByIdAccionCobranza", query = "SELECT a FROM AccionCobranza a WHERE a.idAccionCobranza = :idAccionCobranza"), @NamedQuery(name = "AccionCobranza.findByAnotaciones", query = "SELECT a FROM AccionCobranza a WHERE a.anotaciones = :anotaciones"), @NamedQuery(name = "AccionCobranza.findByResponsable", query = "SELECT a FROM AccionCobranza a WHERE a.responsable = :responsable"), @NamedQuery(name = "AccionCobranza.findByFechaRegistro", query = "SELECT a FROM AccionCobranza a WHERE a.fechaRegistro = :fechaRegistro")})
public class AccionCobranza implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_ACCION_COBRANZA", nullable = false)
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long idAccionCobranza;
    @Column(name = "ANOTACIONES", length = 50)
    private String anotaciones;
    @Column(name = "RESPONSABLE", length = 50)
    private String responsable;
    @Column(name = "FECHA_REGISTRO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaRegistro;
    @JoinColumns({@JoinColumn(name = "FID_REC_CARTERA", referencedColumnName = "ID_CARTERA", nullable = false), @JoinColumn(name = "FID_REC_CREDITO", referencedColumnName = "ID_CREDITO", nullable = false)})
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CreditoCartera creditoCartera;

    public AccionCobranza() {
    }

    public AccionCobranza(Long idAccionCobranza) {
        this.idAccionCobranza = idAccionCobranza;
    }

    public Long getIdAccionCobranza() {
        return idAccionCobranza;
    }

    public void setIdAccionCobranza(Long idAccionCobranza) {
        this.idAccionCobranza = idAccionCobranza;
    }

    public String getAnotaciones() {
        return anotaciones;
    }

    public void setAnotaciones(String anotaciones) {
        this.anotaciones = anotaciones;
    }

    public String getResponsable() {
        return responsable;
    }

    public void setResponsable(String responsable) {
        this.responsable = responsable;
    }

    public Date getFechaRegistro() {
        return fechaRegistro;
    }

    public void setFechaRegistro(Date fechaRegistro) {
        this.fechaRegistro = fechaRegistro;
    }

    public CreditoCartera getCreditoCartera() {
        return creditoCartera;
    }

    public void setCreditoCartera(CreditoCartera creditoCartera) {
        this.creditoCartera = creditoCartera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAccionCobranza != null ? idAccionCobranza.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AccionCobranza)) {
            return false;
        }
        AccionCobranza other = (AccionCobranza) object;
        if ((this.idAccionCobranza == null && other.idAccionCobranza != null) || (this.idAccionCobranza != null && !this.idAccionCobranza.equals(other.idAccionCobranza))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.rec.be.AccionCobranza[idAccionCobranza=" + idAccionCobranza + "]";
    }

}
